﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2021_5_24
{
    //飞机、小鸟、超人：动物
    class Animal
    {
        protected string animalType;

        protected string AnimalType { get => animalType; set => animalType = value; }

        public Animal(string animal)
        {
            animalType = animal;
        }

        public void Eat()
        {
            Console.WriteLine("{0}进食中...", this.animalType);
        }

    }
    //小鸟
    class Bird : Animal, IFlyable
    {
        public Bird() : base(animal: "小鸟") { }

        public void TakeOff()
        {
            Console.WriteLine("{0}准备起飞", this.animalType);
        }
        public void Fly()
        {
            Console.WriteLine("{0}飞行中...,顺带向下面的路人来一发", this.animalType);
        }
        public void Land()
        {
            Console.WriteLine("{0}被路人抓去下蛋了", this.animalType);
        }

        public void LayEggs()
        {
            Console.WriteLine("小鸟下蛋中...");
        }

    }
    //超人
    class Superman : Animal, IFlyable
    {
        public Superman() : base(animal: "超人") { }

        public void TakeOff()
        {
            Console.WriteLine("{0}准备起飞", this.animalType);
        }
        public void Fly()
        {
            Console.WriteLine("{0}飞行中...", this.animalType);
        }
        public void Land()
        {
            Console.WriteLine("{0}准备着陆", this.animalType);
        }
    }
}


